<div id="toolbar" class="toolbar">
	<form id="search_form" class="form-horizontal" style="margin:0">
		<div class="clearfix">
			<div class="filter-groups">
				<div class="control-group">
					<label class="control-label" style="width: 120px;">签收时间</label>
					<div class="controls" style="margin-left:125px;">
						<div class="input-append date" data-format="yyyy-MM-dd hh:mm:ss">
							<input type="text" name="sign_start" style="width: 131px;" value="{:date('Y-m-d 00:00:00', strtotime('-1 day'))}">
							<span class="add-on"><i class="icon-th"></i></span>
						</div>
						至
						<div class="input-append date" data-format="yyyy-MM-dd hh:mm:ss">
							<input type="text" name="sign_end" style="width: 131px;" value="{:date('Y-m-d').' 23:59:59'}">
							<span class="add-on"><i class="icon-th"></i></span>
						</div>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" style="width: 120px;">导入时间</label>
					<div class="controls" style="margin-left:125px;">
						<div class="input-append date" data-format="yyyy-MM-dd hh:mm:ss">
							<input type="text" name="created_start" style="width: 131px;">
							<span class="add-on"><i class="icon-th"></i></span>
						</div>
						至
						<div class="input-append date" data-format="yyyy-MM-dd hh:mm:ss">
							<input type="text" name="created_end" style="width: 131px;">
							<span class="add-on"><i class="icon-th"></i></span>
						</div>
					</div>
				</div>
			</div>
			<div class="filter-groups">
				<div class="control-group">
					<label class="control-label">快递单号</label>
					<div class="controls">
						<input type="text" name="id" maxlength="18"　value="" placeholder="请输入完整的单号">
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">操　　作</label>
					<div class="controls">
						<a href="#importModal" role="button" class="btn" data-toggle="modal">导入</a>
						<input type="button" class="btn btn-info" value="导出" id="btn-export">
						<input type="submit" class="btn btn-primary" value="搜索" style="margin-left:45px">
					</div>
				</div>
			</div>
		</div>
	</form>
</div>
<!-- 表格 -->
<table id="table" data-toggle="gridview" class="table table-hover" data-url="__URL__" data-toolbar="#toolbar"  data-page-list="[1, 10, 25, 50, All]">
	<thead>
		<tr>
			<th data-width="150" data-field="id">快递单号</th>
			<th data-width="150" data-field="created">发货时间</th>
			<th data-width="200" data-field="nickname">派件代理</th>
			<th data-width="150" data-field="mobile">手机号</th>
			<th data-width="150" data-field="sign_time">签收时间</th>
			<th data-width="100" data-field="amount">奖励金额</th>
			<th data-field="times">扫码次数</th>
		</tr>
	</thead>
</table>

<!-- 导入模态框 -->
<form id="importModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" method="post" action="/admin/handbag_express/import" enctype="multipart/form-data" target="_balank">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">导入运单号</h3>
  </div>
  <div class="modal-body">
  	<div class="text-center">
	    <input type="file" name="file">
  	</div>
  </div>
  <div class="modal-footer">
    <button type="button" class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
    <button type="submit" class="btn btn-primary">开始导入</button>
  </div>
</form>

<script>
$(function(){
	$('#btn-export').on('click', function(){
		var data = $('#search_form').serializeArray();
		var url = '__URL__/export?';
		for(var i=0; i<data.length; i++){
			url += (i > 0 ? '&' : '')+data[i].name+'='+data[i].value;
		}
		window.location.href = url;
		return false;
	});
});
</script>